package com.dungnt.model;

import java.text.SimpleDateFormat;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.dungnt.vtime.utils.Constant;
import com.dungnt.vtime.utils.Utils;

public class DbHelper extends SQLiteOpenHelper {
	
//	private static final String TAG = "DbHelper";

	public static final String DB_NAME = "vTime.db";
	public static final int DB_VERSION = 1;
	
	public static final SimpleDateFormat sdf = new SimpleDateFormat(Constant.DEFAULT_DATE_FORMAT);

	public DbHelper(Context context) {
		super(context, DB_NAME, null, DB_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(Alarm.getSql());
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	}

	
	
	 public static final String getDateStr(int year, int month, int date) {
		 return Utils.concat(year, "-", month, "-", date);
	 }
	 
	 public static final String getTimeStr(int hour, int minute) {
		 return Utils.concat(hour, ":", minute>9 ? "":"0", minute);
	 }	 

}
